package com.ms.p2p.provider.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.ms.p2p.bean.PageBean;
import com.ms.p2p.entity.loan.Loan;
import com.ms.p2p.entity.loan.LoanTenderRecord;
import com.ms.p2p.entity.member.Member;
import com.ms.p2p.provider.LoanTenderRecordProvider;
import com.ms.p2p.service.impl.LoanTenderRecordServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * Created by daimajia on 2015/4/19 添加dubbo接口.
 */
@Service
public class LoanTenderRecordProviderImpl implements LoanTenderRecordProvider {

    @Autowired
    LoanTenderRecordServiceImpl loanTenderRecordService;

    public List getList(int loanId) {
        return loanTenderRecordService.getList(loanId);
    }

    public double getUserTenderSum(int loanId, int userId) {
        return loanTenderRecordService.getUserTenderSum(loanId,userId);
    }

    public int addTenderLog(LoanTenderRecord map, BigDecimal max_account, Member user) {
        return loanTenderRecordService.addTenderLog(map,max_account,user);
    }

    public List<LoanTenderRecord> getTenderLog(int loanId) {
        return loanTenderRecordService.getTenderLog(loanId);
    }

    public List<Map<String, Object>> findTenders(int loanId) {
        return loanTenderRecordService.findTenders(loanId);
    }

    public Map<String, Object> sumByBorrowId(int borrowId) {
        return loanTenderRecordService.sumByBorrowId(borrowId);
    }

    public List<Map<String, Object>> findPager(Integer id, String status,PageBean page) {
        return loanTenderRecordService.findPager(id,status,page);
    }

    public int findCount(Integer id,String status) {
        return loanTenderRecordService.findCount(id,status);
    }

    public List<Map<String, Object>> findLoanPager(Integer id, String status, PageBean page) {
        return loanTenderRecordService.findLoanPager(id,status, page);
    }

    public int findLoanCount(Integer id, String status) {
        return loanTenderRecordService.findLoanCount(id,status);
    }

    public LoanTenderRecord findById(int id) {
        return loanTenderRecordService.findById(id);
    }

    public int update(LoanTenderRecord loanTenderRecord) {
        return loanTenderRecordService.update(loanTenderRecord);
    }

    public Map<String, Object> countTotalIncome() {
        return loanTenderRecordService.countTotalIncome();
    }

    public String countWailtAccount() {
        return loanTenderRecordService.countWailtAccount();
    }

    public void doRookie(Member user, Loan borrow) {
   loanTenderRecordService.doRookie(user,borrow);
    }

    public List<Map<String, Object>> findActive() {
        return loanTenderRecordService.findActive();
    }
}
